<template>
	<view class="">
		<view class="">
					{{index+1}}.{{info.name}}	
		</view>
		<radio-group @change="radioChange" :checked="current">
			<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in choses"  :key="item.key" >
			<view>
			 <radio :class="isDisable?'jinyong':''" :disabled="isDisable"  :value="item.key"> 
			 
			 
			 <image v-show="IsWrong&&WrongItem==item.key" class="WrongImg"  src="../../../static/images/yicha/wrong.png" mode=""></image>
			 </radio>
		
			</view>
			<view><text class="keys">{{item.key}}</text> {{item.content}}</view>
			</label>
		</radio-group>
		<view  v-show="!IsWrong&&isDisable" class="Right">
		<text style="color: #007EFF;">回答正确</text>。正确答案选项是{{daAn}}。
		</view>
		<view  v-show="IsWrong" class="Wrong">
			<text style="color: #E81A24;">回答错误</text>。正确答案选项是{{daAn}}。
			<view class="">
				<text>错误解析:</text> {{info.analysis}}
							
			</view>
			
		</view>

	</view>
</template>

<script>
		
	export default{
		props:{
			info:{},
			index:'',
			daAn:null,
			daAnDesc:"",
			choses:Array,
			
		},
		data(){
			return{
				current:null,
				IsWrong:false,
				WrongItem:'',
				isDisable:false,
				evt:{},
				choseD:false
				
			}
		},
		methods:{
			 radioChange: function(evt) {
				 console.log(evt,this.info)
				 this.current = evt.target.value
				 this.evt =evt
				 this.choseD=true
				 // this.ChosedItem =evt.detail.value
				 //选中后 禁止复选
				
			            // for (let i = 0; i < this.choses.length; i++) {
			            //     if (this.choses[i].value === evt.detail.value) {
			            //         this.current = i;
			            //         break;
			            //     }
			            // }
						
			},
				
			judges:function(){
				if( this.choseD){
						this.$emit('ChoseItem',true)	
				}else{
					this.$emit('ChoseItem',false)	
				}
			},
			judge:function(){
			
						this.isDisable=true
						if(	this.current==this.daAn){
							this.IsWrong=false
						}else{
						    this.current=this.info.extend.daan
							this.IsWrong=true
								
							if(this.evt.detail){
								this.WrongItem =this.evt.detail.value
							}
						}
				
					this.$emit('sendAnswer',
									{ topic_id:this.info.id,
									  answer:this.choseD?this.evt.detail.value:"",
									  IsWrong:this.IsWrong})
			}
					
		}
		
	}
	
	
</script>

<style>
		
	.uni-list-cell{
		    display: flex;
		    align-items: center;
			margin-top: 15rpx;
	}
	.keys{
		margin: 0 10rpx;
	}
	.WrongImg{
		    width: 52rpx;
		    height: 52rpx;
		    position: absolute;
		    background: #fff;
		    z-index: 9999;
	}
		
	.Right,.Wrong{
		margin-top: 20rpx;
		border-top: 2rpx solid rgba(197, 197, 197, 0.39);
		padding-top: 20rpx;
	}
/* /deep/	.jinyong .uni-radio-input-checked:before{
	color: #adadad!important;
	}
	/deep/.jinyong .uni-radio-input{
	background-color: #e1e1e1!important;
	border-color: #e1e1e1!important;
	} */
	
</style>
